<?php 
include("../Core/Common.php");
if($_GET['redirect_uri']&&!$_GET['code']){
	        //建造请求参数
			$keysArr = array(
			"redirect_uri" => $_GET['redirect_uri'],
			"state" => $_GET['state']
			);
		
        $login_url = $conf['Instant_url'] . 'api/qq_login_api.php?' . http_build_query($keysArr);
		echo '<script>window.location.href="'.$login_url.'"</script>';//发起登录
}elseif(!$_GET['code']){
	echo'<script>alert("请填写回调地址！");location.href="/"</script>';
}


if($_GET['code']){//接收返回数据
$arr_url=get_curl($conf['Instant_url'] . 'api/qq_login_api.php?code='.$_GET['code'].'&state='.$_GET['state'].'&key='.$_GET['key']);
echo $arr_url;
}
?>